package com.cover.fti.play;

import com.cover.fti.play.Tower.TOWER;
import com.qwerjk.andengine.entity.sprite.PixelPerfectAnimatedSprite;
import com.qwerjk.andengine.opengl.texture.region.PixelPerfectTiledTextureRegion;

public class Bullet extends PixelPerfectAnimatedSprite{

	private int damage;
	private String tipe;
	private float speed;
	private float targetX;
	private float targetY;
	private TOWER tower;
	private int indexTipe;
	private PixelPerfectTiledTextureRegion mBulletPerfectTiledTextureRegion;
	
	public Bullet(float pX, float pY,
			PixelPerfectTiledTextureRegion pTextureRegion, TOWER tower) {
		super(pX, pY, pTextureRegion);
		this.mBulletPerfectTiledTextureRegion = pTextureRegion;
		speed = 0.5f;
		damage = 15;
		this.tower = tower;
		setBullet(tower);
		// TODO Auto-generated constructor stub
	}
	
	public TOWER getTipeTower(){
		return tower;
	}
	
	public int getIndexTipe(){
		return this.indexTipe;
	}
	
	public void setBullet(TOWER tower){
		if(tower == TOWER.NORMAL){
			indexTipe = 0;
			damage = 8;
			speed = 0.5f;
		} else if(tower == TOWER.HEAVY){
			indexTipe = 1;
			damage = 12;
			speed = 0.3f;
		} else if(tower == TOWER.DESTRUCTION){
			indexTipe = 2;
			damage = 15;
			speed = 3f;
		}
	}
	
	public void setTargetX(float targetX){
		this.targetX = targetX;
	}
	
	public float getTargetX(){
		return targetX;
	}
	
	public void setTargetY(float targetY){
		this.targetY = targetY;
	}
	
	public float getTargetY(){
		return targetY;
	}
	
	public void setDamage(int damage){
		this.damage = damage;
	}
	
	public int getDamage(){
		return damage;
	}
	
	public void setTipe(String tipe){
		this.tipe = tipe;
	}
	
	public String getTipe(){
		return tipe;
	}

	public void setSpeed(float speed){
		this.speed = speed;
	}
	
	public float getSpeed(){
		return speed;
	}
	
	public PixelPerfectTiledTextureRegion getMBullPerfectTiledTextureRegion(){
		return mBulletPerfectTiledTextureRegion;
	}
}
